package org.sbbs.dao;

import org.sbbs.base.jpa.dao.BaseRepo;
import org.sbbs.entity.Book;
import org.springframework.data.repository.query.Param;
//import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

@RepositoryRestResource(collectionResourceRel = "books", path = "book")
public interface BookRepo extends BaseRepo<Book, Long> {
    Page<Book> findByName(@Param("name") String name,Pageable pageable);
    Page<Book> findByNameLike(@Param("name") String name,Pageable pageable);
    Page<Book> findByNameStartingWith(@Param("name") String name,Pageable pageable);
    Page<Book> findByNameEndingWith(@Param("name") String name,Pageable pageable);
    Page<Book> findByNameContaining(@Param("name") String name,Pageable pageable);
}